Integrand size = 23, antiderivative size = 166 \[ \int \frac {1}{(c+d x)^2 (a+i a \cot (e+f x))} \, dx=-\frac {i f \cos \left (2 e-\frac {2 c f}{d}\right ) \operatorname {CosIntegral}\left (\frac {2 c f}{d}+2 f x\right )}{a d^2}-\frac {1}{d (c+d x) (a+i a \cot (e+f x))}+\frac {f \operatorname {CosIntegral}\left (\frac {2 c f}{d}+2 f x\right ) \sin \left (2 e-\frac {2 c f}{d}\right )}{a d^2}+\frac {f \cos \left (2 e-\frac {2 c f}{d}\right ) \text {Si}\left (\frac {2 c f}{d}+2 f x\right )}{a d^2}+\frac {i f \sin \left (2 e-\frac {2 c f}{d}\right ) \text {Si}\left (\frac {2 c f}{d}+2 f x\right )}{a d^2} \]
-I*f*Ci(2*c*f/d+2*f*x)*cos(-2*e+2*c*f/d)/a/d^2-1/d/(d*x+c)/(a+I*a*cot(f*x+ e))+f*cos(-2*e+2*c*f/d)*Si(2*c*f/d+2*f*x)/a/d^2-f*Ci(2*c*f/d+2*f*x)*sin(-2 *e+2*c*f/d)/a/d^2-I*f*Si(2*c*f/d+2*f*x)*sin(-2*e+2*c*f/d)/a/d^2
Time = 1.34 (sec) , antiderivative size = 215, normalized size of antiderivative = 1.30 \[ \int \frac {1}{(c+d x)^2 (a+i a \cot (e+f x))} \, dx=\frac {\left (\cos \left (e+f \left (-\frac {c}{d}+x\right )\right )+i \sin \left (e+f \left (-\frac {c}{d}+x\right )\right )\right ) \left (d \left (-\cos \left (e+f \left (-\frac {c}{d}+x\right )\right )+\cos \left (e+f \left (\frac {c}{d}+x\right )\right )+i \left (\sin \left (e+f \left (-\frac {c}{d}+x\right )\right )+\sin \left (e+f \left (\frac {c}{d}+x\right )\right )\right )\right )+2 f (c+d x) \operatorname {CosIntegral}\left (\frac {2 f (c+d x)}{d}\right ) \left (-i \cos \left (e-\frac {f (c+d x)}{d}\right )+\sin \left (e-\frac {f (c+d x)}{d}\right )\right )+2 f (c+d x) \left (\cos \left (e-\frac {f (c+d x)}{d}\right )+i \sin \left (e-\frac {f (c+d x)}{d}\right )\right ) \text {Si}\left (\frac {2 f (c+d x)}{d}\right )\right )}{2 a d^2 (c+d x)} \]
((Cos[e + f*(-(c/d) + x)] + I*Sin[e + f*(-(c/d) + x)])*(d*(-Cos[e + f*(-(c /d) + x)] + Cos[e + f*(c/d + x)] + I*(Sin[e + f*(-(c/d) + x)] + Sin[e + f* (c/d + x)])) + 2*f*(c + d*x)*CosIntegral[(2*f*(c + d*x))/d]*((-I)*Cos[e - (f*(c + d*x))/d] + Sin[e - (f*(c + d*x))/d]) + 2*f*(c + d*x)*(Cos[e - (f*( c + d*x))/d] + I*Sin[e - (f*(c + d*x))/d])*SinIntegral[(2*f*(c + d*x))/d]) )/(2*a*d^2*(c + d*x))
Time = 0.71 (sec) , antiderivative size = 166, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.348, Rules used = {3042, 4207, 25, 3042, 3784, 3042, 3780, 3783}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \frac {1}{(c+d x)^2 (a+i a \cot (e+f x))} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {1}{(c+d x)^2 \left (a-i a \tan \left (e+f x+\frac {\pi }{2}\right )\right )}dx\) |
\(\Big \downarrow \) 4207 |
\(\displaystyle -\frac {f \int -\frac {\sin (2 e+2 f x)}{c+d x}dx}{a d}+\frac {i f \int -\frac {\cos (2 e+2 f x)}{c+d x}dx}{a d}-\frac {1}{d (c+d x) (a+i a \cot (e+f x))}\) |
\(\Big \downarrow \) 25 |
\(\displaystyle \frac {f \int \frac {\sin (2 e+2 f x)}{c+d x}dx}{a d}-\frac {i f \int \frac {\cos (2 e+2 f x)}{c+d x}dx}{a d}-\frac {1}{d (c+d x) (a+i a \cot (e+f x))}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {f \int \frac {\sin (2 e+2 f x)}{c+d x}dx}{a d}-\frac {i f \int \frac {\sin \left (2 e+2 f x+\frac {\pi }{2}\right )}{c+d x}dx}{a d}-\frac {1}{d (c+d x) (a+i a \cot (e+f x))}\) |
\(\Big \downarrow \) 3784 |
\(\displaystyle \frac {f \left (\sin \left (2 e-\frac {2 c f}{d}\right ) \int \frac {\cos \left (2 x f+\frac {2 c f}{d}\right )}{c+d x}dx+\cos \left (2 e-\frac {2 c f}{d}\right ) \int \frac {\sin \left (2 x f+\frac {2 c f}{d}\right )}{c+d x}dx\right )}{a d}-\frac {i f \left (\cos \left (2 e-\frac {2 c f}{d}\right ) \int \frac {\cos \left (2 x f+\frac {2 c f}{d}\right )}{c+d x}dx-\sin \left (2 e-\frac {2 c f}{d}\right ) \int \frac {\sin \left (2 x f+\frac {2 c f}{d}\right )}{c+d x}dx\right )}{a d}-\frac {1}{d (c+d x) (a+i a \cot (e+f x))}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle -\frac {i f \left (\cos \left (2 e-\frac {2 c f}{d}\right ) \int \frac {\sin \left (2 x f+\frac {2 c f}{d}+\frac {\pi }{2}\right )}{c+d x}dx-\sin \left (2 e-\frac {2 c f}{d}\right ) \int \frac {\sin \left (2 x f+\frac {2 c f}{d}\right )}{c+d x}dx\right )}{a d}+\frac {f \left (\sin \left (2 e-\frac {2 c f}{d}\right ) \int \frac {\sin \left (2 x f+\frac {2 c f}{d}+\frac {\pi }{2}\right )}{c+d x}dx+\cos \left (2 e-\frac {2 c f}{d}\right ) \int \frac {\sin \left (2 x f+\frac {2 c f}{d}\right )}{c+d x}dx\right )}{a d}-\frac {1}{d (c+d x) (a+i a \cot (e+f x))}\) |
\(\Big \downarrow \) 3780 |
\(\displaystyle -\frac {i f \left (\cos \left (2 e-\frac {2 c f}{d}\right ) \int \frac {\sin \left (2 x f+\frac {2 c f}{d}+\frac {\pi }{2}\right )}{c+d x}dx-\frac {\sin \left (2 e-\frac {2 c f}{d}\right ) \text {Si}\left (2 x f+\frac {2 c f}{d}\right )}{d}\right )}{a d}+\frac {f \left (\sin \left (2 e-\frac {2 c f}{d}\right ) \int \frac {\sin \left (2 x f+\frac {2 c f}{d}+\frac {\pi }{2}\right )}{c+d x}dx+\frac {\cos \left (2 e-\frac {2 c f}{d}\right ) \text {Si}\left (2 x f+\frac {2 c f}{d}\right )}{d}\right )}{a d}-\frac {1}{d (c+d x) (a+i a \cot (e+f x))}\) |
\(\Big \downarrow \) 3783 |
\(\displaystyle \frac {f \left (\frac {\operatorname {CosIntegral}\left (2 x f+\frac {2 c f}{d}\right ) \sin \left (2 e-\frac {2 c f}{d}\right )}{d}+\frac {\cos \left (2 e-\frac {2 c f}{d}\right ) \text {Si}\left (2 x f+\frac {2 c f}{d}\right )}{d}\right )}{a d}-\frac {i f \left (\frac {\operatorname {CosIntegral}\left (2 x f+\frac {2 c f}{d}\right ) \cos \left (2 e-\frac {2 c f}{d}\right )}{d}-\frac {\sin \left (2 e-\frac {2 c f}{d}\right ) \text {Si}\left (2 x f+\frac {2 c f}{d}\right )}{d}\right )}{a d}-\frac {1}{d (c+d x) (a+i a \cot (e+f x))}\) |
-(1/(d*(c + d*x)*(a + I*a*Cot[e + f*x]))) + (f*((CosIntegral[(2*c*f)/d + 2 *f*x]*Sin[2*e - (2*c*f)/d])/d + (Cos[2*e - (2*c*f)/d]*SinIntegral[(2*c*f)/ d + 2*f*x])/d))/(a*d) - (I*f*((Cos[2*e - (2*c*f)/d]*CosIntegral[(2*c*f)/d + 2*f*x])/d - (Sin[2*e - (2*c*f)/d]*SinIntegral[(2*c*f)/d + 2*f*x])/d))/(a *d)
3.1.20.3.1 Defintions of rubi rules used
Int[sin[(e_.) + (f_.)*(x_)]/((c_.) + (d_.)*(x_)), x_Symbol] :> Simp[SinInte gral[e + f*x]/d, x] /; FreeQ[{c, d, e, f}, x] && EqQ[d*e - c*f, 0]
Int[sin[(e_.) + (f_.)*(x_)]/((c_.) + (d_.)*(x_)), x_Symbol] :> Simp[CosInte gral[e - Pi/2 + f*x]/d, x] /; FreeQ[{c, d, e, f}, x] && EqQ[d*(e - Pi/2) - c*f, 0]
Int[sin[(e_.) + (f_.)*(x_)]/((c_.) + (d_.)*(x_)), x_Symbol] :> Simp[Cos[(d* e - c*f)/d] Int[Sin[c*(f/d) + f*x]/(c + d*x), x], x] + Simp[Sin[(d*e - c* f)/d] Int[Cos[c*(f/d) + f*x]/(c + d*x), x], x] /; FreeQ[{c, d, e, f}, x] && NeQ[d*e - c*f, 0]
Int[1/(((c_.) + (d_.)*(x_))^2*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])), x_Sy mbol] :> -Simp[(d*(c + d*x)*(a + b*Tan[e + f*x]))^(-1), x] + (-Simp[f/(a*d) Int[Sin[2*e + 2*f*x]/(c + d*x), x], x] + Simp[f/(b*d) Int[Cos[2*e + 2* f*x]/(c + d*x), x], x]) /; FreeQ[{a, b, c, d, e, f}, x] && EqQ[a^2 + b^2, 0 ]
Time = 0.28 (sec) , antiderivative size = 105, normalized size of antiderivative = 0.63
method | result | size |
risch | \(-\frac {1}{2 d \left (d x +c \right ) a}+\frac {i f \,{\mathrm e}^{2 i \left (f x +e \right )}}{2 a \,d^{2} \left (i f x +\frac {i c f}{d}\right )}+\frac {i f \,{\mathrm e}^{-\frac {2 i \left (c f -d e \right )}{d}} \operatorname {Ei}_{1}\left (-2 i f x -2 i e -\frac {2 \left (i c f -i d e \right )}{d}\right )}{a \,d^{2}}\) | \(105\) |
derivativedivides | \(\frac {f \left (-\frac {i \left (-\frac {2 \sin \left (2 f x +2 e \right )}{\left (c f -d e +d \left (f x +e \right )\right ) d}+\frac {\frac {4 \,\operatorname {Si}\left (2 f x +2 e +\frac {2 c f -2 d e}{d}\right ) \sin \left (\frac {2 c f -2 d e}{d}\right )}{d}+\frac {4 \,\operatorname {Ci}\left (2 f x +2 e +\frac {2 c f -2 d e}{d}\right ) \cos \left (\frac {2 c f -2 d e}{d}\right )}{d}}{d}\right )}{4}-\frac {1}{2 \left (c f -d e +d \left (f x +e \right )\right ) d}+\frac {\cos \left (2 f x +2 e \right )}{2 \left (c f -d e +d \left (f x +e \right )\right ) d}+\frac {\frac {2 \,\operatorname {Si}\left (2 f x +2 e +\frac {2 c f -2 d e}{d}\right ) \cos \left (\frac {2 c f -2 d e}{d}\right )}{d}-\frac {2 \,\operatorname {Ci}\left (2 f x +2 e +\frac {2 c f -2 d e}{d}\right ) \sin \left (\frac {2 c f -2 d e}{d}\right )}{d}}{2 d}\right )}{a}\) | \(271\) |
default | \(\frac {f \left (-\frac {i \left (-\frac {2 \sin \left (2 f x +2 e \right )}{\left (c f -d e +d \left (f x +e \right )\right ) d}+\frac {\frac {4 \,\operatorname {Si}\left (2 f x +2 e +\frac {2 c f -2 d e}{d}\right ) \sin \left (\frac {2 c f -2 d e}{d}\right )}{d}+\frac {4 \,\operatorname {Ci}\left (2 f x +2 e +\frac {2 c f -2 d e}{d}\right ) \cos \left (\frac {2 c f -2 d e}{d}\right )}{d}}{d}\right )}{4}-\frac {1}{2 \left (c f -d e +d \left (f x +e \right )\right ) d}+\frac {\cos \left (2 f x +2 e \right )}{2 \left (c f -d e +d \left (f x +e \right )\right ) d}+\frac {\frac {2 \,\operatorname {Si}\left (2 f x +2 e +\frac {2 c f -2 d e}{d}\right ) \cos \left (\frac {2 c f -2 d e}{d}\right )}{d}-\frac {2 \,\operatorname {Ci}\left (2 f x +2 e +\frac {2 c f -2 d e}{d}\right ) \sin \left (\frac {2 c f -2 d e}{d}\right )}{d}}{2 d}\right )}{a}\) | \(271\) |
-1/2/d/(d*x+c)/a+1/2*I/a*f/d^2*exp(2*I*(f*x+e))/(I*f*x+I/d*c*f)+I/a*f/d^2* exp(-2*I*(c*f-d*e)/d)*Ei(1,-2*I*f*x-2*I*e-2*(I*c*f-I*d*e)/d)
Time = 0.25 (sec) , antiderivative size = 74, normalized size of antiderivative = 0.45 \[ \int \frac {1}{(c+d x)^2 (a+i a \cot (e+f x))} \, dx=-\frac {2 \, {\left (i \, d f x + i \, c f\right )} {\rm Ei}\left (-\frac {2 \, {\left (-i \, d f x - i \, c f\right )}}{d}\right ) e^{\left (-\frac {2 \, {\left (-i \, d e + i \, c f\right )}}{d}\right )} - d e^{\left (2 i \, f x + 2 i \, e\right )} + d}{2 \, {\left (a d^{3} x + a c d^{2}\right )}} \]
-1/2*(2*(I*d*f*x + I*c*f)*Ei(-2*(-I*d*f*x - I*c*f)/d)*e^(-2*(-I*d*e + I*c* f)/d) - d*e^(2*I*f*x + 2*I*e) + d)/(a*d^3*x + a*c*d^2)
\[ \int \frac {1}{(c+d x)^2 (a+i a \cot (e+f x))} \, dx=- \frac {i \int \frac {1}{c^{2} \cot {\left (e + f x \right )} - i c^{2} + 2 c d x \cot {\left (e + f x \right )} - 2 i c d x + d^{2} x^{2} \cot {\left (e + f x \right )} - i d^{2} x^{2}}\, dx}{a} \]
-I*Integral(1/(c**2*cot(e + f*x) - I*c**2 + 2*c*d*x*cot(e + f*x) - 2*I*c*d *x + d**2*x**2*cot(e + f*x) - I*d**2*x**2), x)/a
Time = 0.38 (sec) , antiderivative size = 121, normalized size of antiderivative = 0.73 \[ \int \frac {1}{(c+d x)^2 (a+i a \cot (e+f x))} \, dx=\frac {f^{2} \cos \left (-\frac {2 \, {\left (d e - c f\right )}}{d}\right ) E_{2}\left (\frac {2 \, {\left (-i \, {\left (f x + e\right )} d + i \, d e - i \, c f\right )}}{d}\right ) - i \, f^{2} E_{2}\left (\frac {2 \, {\left (-i \, {\left (f x + e\right )} d + i \, d e - i \, c f\right )}}{d}\right ) \sin \left (-\frac {2 \, {\left (d e - c f\right )}}{d}\right ) - f^{2}}{2 \, {\left ({\left (f x + e\right )} a d^{2} - a d^{2} e + a c d f\right )} f} \]
1/2*(f^2*cos(-2*(d*e - c*f)/d)*exp_integral_e(2, 2*(-I*(f*x + e)*d + I*d*e - I*c*f)/d) - I*f^2*exp_integral_e(2, 2*(-I*(f*x + e)*d + I*d*e - I*c*f)/ d)*sin(-2*(d*e - c*f)/d) - f^2)/(((f*x + e)*a*d^2 - a*d^2*e + a*c*d*f)*f)
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 357 vs. \(2 (161) = 322\).
Time = 1.08 (sec) , antiderivative size = 357, normalized size of antiderivative = 2.15 \[ \int \frac {1}{(c+d x)^2 (a+i a \cot (e+f x))} \, dx=-\frac {i \, {\left (-2 i \, {\left (d x + c\right )} {\left (\frac {i \, d e}{d x + c} - \frac {i \, c f}{d x + c} + i \, f\right )} f^{2} {\rm Ei}\left (\frac {2 \, {\left ({\left (d x + c\right )} {\left (\frac {i \, d e}{d x + c} - \frac {i \, c f}{d x + c} + i \, f\right )} - i \, d e + i \, c f\right )}}{d}\right ) e^{\left (-\frac {2 \, {\left (-i \, d e + i \, c f\right )}}{d}\right )} - 2 \, d e f^{2} {\rm Ei}\left (\frac {2 \, {\left ({\left (d x + c\right )} {\left (\frac {i \, d e}{d x + c} - \frac {i \, c f}{d x + c} + i \, f\right )} - i \, d e + i \, c f\right )}}{d}\right ) e^{\left (-\frac {2 \, {\left (-i \, d e + i \, c f\right )}}{d}\right )} + 2 \, c f^{3} {\rm Ei}\left (\frac {2 \, {\left ({\left (d x + c\right )} {\left (\frac {i \, d e}{d x + c} - \frac {i \, c f}{d x + c} + i \, f\right )} - i \, d e + i \, c f\right )}}{d}\right ) e^{\left (-\frac {2 \, {\left (-i \, d e + i \, c f\right )}}{d}\right )} + i \, d f^{2} e^{\left (-\frac {2 \, {\left (d x + c\right )} {\left (-\frac {i \, d e}{d x + c} + \frac {i \, c f}{d x + c} - i \, f\right )}}{d}\right )}\right )} d^{2}}{2 \, {\left (-i \, {\left (d x + c\right )} d^{4} {\left (\frac {i \, d e}{d x + c} - \frac {i \, c f}{d x + c} + i \, f\right )} - d^{5} e + c d^{4} f\right )} a f} - \frac {1}{2 \, {\left (d x + c\right )} a d} \]
-1/2*I*(-2*I*(d*x + c)*(I*d*e/(d*x + c) - I*c*f/(d*x + c) + I*f)*f^2*Ei(2* ((d*x + c)*(I*d*e/(d*x + c) - I*c*f/(d*x + c) + I*f) - I*d*e + I*c*f)/d)*e ^(-2*(-I*d*e + I*c*f)/d) - 2*d*e*f^2*Ei(2*((d*x + c)*(I*d*e/(d*x + c) - I* c*f/(d*x + c) + I*f) - I*d*e + I*c*f)/d)*e^(-2*(-I*d*e + I*c*f)/d) + 2*c*f ^3*Ei(2*((d*x + c)*(I*d*e/(d*x + c) - I*c*f/(d*x + c) + I*f) - I*d*e + I*c *f)/d)*e^(-2*(-I*d*e + I*c*f)/d) + I*d*f^2*e^(-2*(d*x + c)*(-I*d*e/(d*x + c) + I*c*f/(d*x + c) - I*f)/d))*d^2/((-I*(d*x + c)*d^4*(I*d*e/(d*x + c) - I*c*f/(d*x + c) + I*f) - d^5*e + c*d^4*f)*a*f) - 1/2/((d*x + c)*a*d)
Timed out. \[ \int \frac {1}{(c+d x)^2 (a+i a \cot (e+f x))} \, dx=\int \frac {1}{\left (a+a\,\mathrm {cot}\left (e+f\,x\right )\,1{}\mathrm {i}\right )\,{\left (c+d\,x\right )}^2} \,d x \]